package com.redlion.object;

import org.andengine.entity.sprite.Sprite;
import org.andengine.extension.physics.box2d.PhysicsFactory;
import org.andengine.extension.physics.box2d.PhysicsWorld;
import org.andengine.opengl.texture.region.ITextureRegion;
import org.andengine.opengl.texture.region.TextureRegion;

import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.Body;
import com.badlogic.gdx.physics.box2d.FixtureDef;
import com.badlogic.gdx.physics.box2d.BodyDef.BodyType;
import com.redlion.Game;

public abstract class AbstractObject {
	public Sprite sprite;
	public Body body;
	protected ITextureRegion mTextureRegion;

	public AbstractObject(Vector2 position, ITextureRegion textureRegion, FixtureDef fixtureDef) {
		this.mTextureRegion = textureRegion;
		createSprite(position.x, position.y);
		createBody(fixtureDef);
	}

	protected abstract void createSprite();

	protected abstract void createSprite(float px, float py);

	protected abstract void createBody(FixtureDef fixtureDef);

	public Object userData() {
		return body.getUserData();
	}

	public void userData(Object userData) {
		body.setUserData(userData);
	}
}
